//
//  ZBHUD.m
//  PaoPao
//
//  Created by xzb on 2018/4/12.
//  Copyright © 2018年 paopao. All rights reserved.
//

#import "ZBHUD.h"
#import "SVProgressHUD.h"
@implementation ZBHUD

+ (void)config
{
    //    [SVProgressHUD setDefaultStyle:SVProgressHUDStyleLight];
    //黑色
    [SVProgressHUD setDefaultStyle:SVProgressHUDStyleDark];
    [SVProgressHUD setMinimumSize:CGSizeMake(100, 100)];
    [SVProgressHUD setMinimumDismissTimeInterval:2];
}

+ (void)configContainerView:(UIView *)view
{
    [SVProgressHUD setContainerView:view];
}

+ (void)show
{
    [self showWithMessage:@"加载中..."];
}

+ (void)showWithMessage:(NSString *)message
{
    [SVProgressHUD showWithStatus:message];
}

+ (void)showInfo:(NSString *)message
{
    [SVProgressHUD showInfoWithStatus:message];
}

+ (void)showSuccess:(NSString *)message
{
    if (message.length < 1) return;
    [SVProgressHUD showSuccessWithStatus:message];
}
+ (void)showOnCompleteSuccess:(NSString *)message
{
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [ZBHUD showSuccess:message];
    });
}
+ (void)showError:(NSString *)message
{
    if (message.length < 1) return;
    [SVProgressHUD showErrorWithStatus:message];
}

+ (void)showProgress:(float)progress
{
    [SVProgressHUD showProgress:progress status:@"上传中..."];
}
+ (void)hidden
{
    [SVProgressHUD dismiss];
}


@end
